
//////////////////////////////////////////////////////////////////////////////////
//	StrokeWidthControl.cs
//  Change the the strokewidth of the current pen
//	Written by Cosic Nadin and Franz Thomas Reinisch FH-Joanneum ITM06
//  
//////////////////////////////////////////////////////////////////////////////////



using System;
using System.Collections.Generic;
using System.Text;
using System.Timers;

namespace WiiFlipChart
{
    class StrokeWidthControl
    {
        private int currentstrokewidth;
      

        public event EventHandler StrokeWidthChanged;




        static readonly StrokeWidthControl instance = new StrokeWidthControl();

        public static StrokeWidthControl Instance
        {
            get
            {
                return instance;
            }
        }

        /// <summary>
        /// Constructor
        /// set the current strokewidth on the value "1"
        /// </summary>
        StrokeWidthControl()
        {
            currentstrokewidth = 1;
        }
        
        

        /// <summary>
        /// fires the event if the strokewidth was changed
        /// </summary>
        /// <param name="ea"></param>
        protected void OnStrokeWidthChanged(EventArgs ea)
        {
            if (StrokeWidthChanged != null)
            {
                StrokeWidthChanged(this, ea);
            }
        }

        /// <summary>
        /// Change the stroke with
        /// and fire this event
        /// </summary>
        public void changecurrentStrokeWidth()
        {


                //increase the StrokeWidth
                currentstrokewidth++;


                if (currentstrokewidth > 5)
                {
                    currentstrokewidth = 1;
                }

                //Fire the Event   
                OnStrokeWidthChanged(EventArgs.Empty);
          
  
        }




        /// <summary>
        /// return the current strokewith as a integer from 1 to 5
        /// </summary>
        /// <returns> return the current strokewith as a integer from 1 to 5</returns>
        public int getcurrentstrokewidth()
        {
            return currentstrokewidth;

        }

    
    
    }
}
